Typical computing systems include a monitoring mechanism for estimating how often certain events happen during execution of one or more applications. For example, a monitoring mechanism may install multiple triggers, each trigger associated with a particular event. As the application operates, the triggers are fired as an event occurs, thus providing an indication to the monitoring mechanism of the event occurrence. However, there are various costs associated with such a monitoring approach: (1) a cost associated with installation and removal of the triggers; and (2) a cost when a trigger is fired. The first cost may be reduced by installing and removing triggers in batches at the same time. However, there is a fundamental problem with the second cost. When a large number of triggers fire in a short period of time, the sum total of the second cost may overwhelm available resources and cause performance issues of the system being monitored. Such a large number of triggers may cause an apparent pause in the execution of the computer system, as the system is using all available resources to process the firing of the triggers. A pause may result in a timeout-based failure detector rendering the computer system inoperable.
Typically, the monitoring system assigns the triggers randomly to events and then monitors the triggered events for a specific time period before removing the triggers. Such an approach can result in inaccurate monitoring as the events are assigned triggers randomly. Additionally, as described above, a flurry of events may be called at the same time, resulting in a high number of triggers that exceeds the time and resources devoted to monitoring the events, thus resulting in a system execution error.